/***************************************************************************
 *   Copyright (C) 2008 by Camille Gallet   *
 *      *
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 *   This program is distributed in the hope that it will be useful,       *
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
 *   GNU General Public License for more details.                          *
 *                                                                         *
 *   You should have received a copy of the GNU General Public License     *
 *   along with this program; if not, write to the                         *
 *   Free Software Foundation, Inc.,                                       *
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
 ***************************************************************************/
#ifndef _PROLOGENGINE_
#define _PROLOGENGINE_

#include "plInterface.hpp"
#include "GameEngine.hpp"

class PrologEngine : public QObject
{
    Q_OBJECT

public:
    PrologEngine();
    ~PrologEngine();
    /**
     *Play a move
     *@param Moving the move
     *@param GameEngine::box* the board
     *@param GameEngine::player the player
     *@return bool true if it has succeded
     */
    bool jouer(Moving &m, GameEngine::box* plateau, GameEngine::player p);
    /**
     *Get the best move
     *@param GameEngine::box* the board
     *@param GameEngine::player the player
     *@return Moving what to play
     */
     Moving getBestMove(GameEngine::box* plateau, GameEngine::player p);


public slots:
	void recupAskingMove(GameEngine::box* plateau, GameEngine::player p);
     	void victoire(bool& vict,GameEngine::box* plateau, GameEngine::player p);
     	void coupValide(bool& ok,Moving &m, GameEngine::box* plateau, GameEngine::player p);
        void humanPlay(GameEngine::box* plateau, Moving &m, GameEngine::player p);
signals:
	void sendIAMove(Moving &m);
private:
    PlInterface* pl;
};

#endif
